function randomNum(maxNum, minNum, decimalNum) {
  var max = 0, min = 0;
  minNum <= maxNum ? (min = minNum, max = maxNum) : (min = maxNum, max = minNum);
  switch (arguments.length) {
    case 1:
      return Math.floor(Math.random() * (max + 1));
      break;
    case 2:
      return Math.floor(Math.random() * (max - min + 1) + min);
      break;
    case 3:
      return (Math.random() * (max - min) + min).toFixed(decimalNum);
      break;
    default:
      return Math.random();
      break;
  }
}


let arr = []
for (var k = 0; k < 50; k++) {
  let t = randomNum(0, 2, 2);
  let t1 = randomNum(0, 2, 2);
  arr.push(
    [t, t1]
  )
}
console.log(arr)




var str = "";
var err = 0;
for (var i = 11; i < 19; i++) {
  let t = randomNum(6, i, 2);
  if (t < 6 || t > 15)
    err++;
  str += t;
  if (i % 2 == 0) {
    str += '\r';
  }
  else
    str += '==';
}
console.log(err + "\r" + str);
